<template>
  <div class="tips-box">
    <el-upload
      class="upload-demo"
      drag
      action="http://localhost:8081/adminPage/addDependencyTxt/"
      multiple>
      <i class="el-icon-upload"></i>
      <div class="el-upload__text">将txt文件拖到此处，或<em>【点击上传】</em></div>
    </el-upload>
    <a :href=tipsFileDownloadUrl>
      <div class="downloadTxt">【更新依Tips前，请保存当前依赖的Tips】</div>
    </a>
  </div>
</template>

<script>
    export default {
        name: "AdminSetting-Tips",
        data(){
            return{
                tipsFileDownloadUrl:'javascript:;',

                baseURL:'http://localhost:8081/adminPage/getTipsFileDownloadUrl',
            }
        },
        mounted() {
            this.$emit("component","tips")
            this.axios.post(this.baseURL).then(res=>{
                if (res.data != false) {
                    this.tipsFileDownloadUrl = res.data
                }
            }).catch(
                exception=>{
                    console.log(exception)
                }
            )
        }
    }
</script>

<style scoped>
  .tips-box{
    width: 97.2%;
    /*height: 200px;*/
    /*width: 400px;*/
    margin-top: 10px;
    border-radius: 6px;
    padding: 15px 15px;
    background-color: #f0f0f4;
  }
  .upload-demo{
    /*width: 800px;*/
    margin: 0px auto;
  }
  .downloadTxt{
    width: 358px;
    height: 40px;
    line-height: 40px;
    border-radius: 6px;
    font-weight: bolder;
    font-size: 13px;
    letter-spacing: 2px;
    text-align: center;
    color: #9d9d9d;
    border: 1px dashed #d7d7d7;
    background-color: white;
    margin-top: 10px;
    transition: 0.05s;
  }
  .downloadTxt:hover{
    color: #686868;
    border: 1px dashed #4d8e90;

    background-color: rgba(99, 186, 188, 0.16);
  }
  .downloadTxt:active{
    background-color: rgba(77, 142, 144, 0.19);
  }
</style>
